package edu.whu.irlab.woscrawl.pubmed;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by zhongwei on 2017/3/3.
 */
public class Filter {

    public static void main(String[] args) throws IOException {
        for (int i = 1; i <= 45; i++) {
            String content = FileUtils.readFileToString(new File("linksToDo_" + i + ".txt"));
            String[] arr = content.split("\n\n\n");
            FileWriter fileWriter = new FileWriter("linksTo_" + i + ".txt");
            for (String str : arr) {
                if (str.contains("\n\n"))
                    continue;
                fileWriter.write(str + "\n\n\n");
            }
            fileWriter.flush();
            fileWriter.close();
        }
    }
}
